package ex401.shape;

public class LaderComponent extends Component {
    private double top;
    private double bottom;
    private double height;

    public LaderComponent(Character type, Double top, Double bottom, Double height) {
        super(type);
        this.top = top;
        this.bottom = bottom;
        this.height = height;
    }

    @Override
    public double getArea() {
        return (top + bottom) * height / 2.0;
    }

    @Override
    public String toString() {
        return "LaderComponent[" + getType() + "," + top + "," + bottom + "," + height + ']';
    }

    public double getTop() {
        return top;
    }

    public void setTop(double top) {
        this.top = top;
    }

    public double getBottom() {
        return bottom;
    }

    public void setBottom(double bottom) {
        this.bottom = bottom;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
